<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
<script>
    //0转化为boolean类型结果是false
    //NaN转化为boolean类型也是false
    //除了0和NaN之外的其他数字转化为boolean类型都为true
    //空字符是false 有一个空格是true
    //undefined和null都是false
    var num = 0;
    console.log(!!num);
    var num1 = 123;
    var num2 =-1;
    console.log(!!num1,!!num2);
    console.log(!!null,!!undefined);
    //!!是隐式转化  Bollean()是强制转化
</script>
</html>